package com.xunyin.modules.version2.mtuserbalance.rest;


import com.xunyin.api.ApiResult;
import com.xunyin.modules.log.AppLog;
import com.xunyin.modules.mtuserbalance.domain.MtUserBalance;
import com.xunyin.modules.mtuserbalance.service.MtUserBalanceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 用户门店余额控制器
 * </p>
 * Created by xunyin
 * CopyRight 讯音云商 https://www.tonetn.com
 *
 * @since 2023-4-24
 */
@Slf4j
@RestController
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
@Api(value = " 用户门店余额模块", tags = "共享空间: 用户门店余额模块")
public class ClientMtUserBalanceController {

    private final MtUserBalanceService mtUserBalanceService;


    /**
     * 获取用户门店余额列表
     */
    @AppLog(value = "获取用户门店余额列表", type = 1)
    //@AuthCheck
    @PostMapping("/user/userBalanceList")
    @ApiOperation(value = "获取用户门店余额列表", notes = "获取用户门店余额列表")
    public ApiResult<List<MtUserBalance>> getUserBalanceList(HttpServletRequest request, @RequestBody Map<String, Object> param) {

        List<MtUserBalance> dataList = mtUserBalanceService.queryMtUserBalanceByParams(param);
        log.info("getUserBalanceList -> dataList={}", dataList.toString());
        return ApiResult.ok(dataList);

    }

}
